<?php
/**
 * 后台路由
 * Created by PhpStorm.
 * User: simon
 * Date: 2017/6/10
 * Time: 18:13
 */

/*后台首页*/
Route::get('/', ['as' => 'admin.index', function () {
    return redirect('admin/index');
}]);
/*后台控制面板*/
Route::get('index', ['as' => 'admin.index', 'uses' => 'IndexController@index']);
Route::get('logout', ['as' => 'admin.logout', 'uses' => 'AuthController@logout']);

/*权限管理路由*/
Route::get('permission/{cid}/create', ['as' => 'admin.permission.create', 'uses' => 'PermissionController@create']);
Route::get('permission/{cid?}', ['as' => 'admin.permission.index', 'uses' => 'PermissionController@index']);  //列表
Route::post('permission/index', ['as' => 'admin.permission.index', 'uses' => 'PermissionController@index']); //查询
Route::resource('permission', 'PermissionController');
Route::put('permission/update', ['as' => 'admin.permission.edit', 'uses' => 'PermissionController@update']); //修改
Route::post('permission/store', ['as' => 'admin.permission.create', 'uses' => 'PermissionController@store']); //添加
Route::post('permission/listorder', ['as' => 'admin.permission.listorder', 'uses' => 'PermissionController@listorder']); //排序

/*角色管理路由*/
Route::get('role/index', ['as' => 'admin.role.index', 'uses' => 'RoleController@index']); //列表
Route::post('role/index', ['as' => 'admin.role.index', 'uses' => 'RoleController@index']); //查询
Route::resource('role', 'RoleController');
Route::put('role/update', ['as' => 'admin.role.edit', 'uses' => 'RoleController@update']); //修改
Route::post('role/store', ['as' => 'admin.role.create', 'uses' => 'RoleController@store']); //添加

/*用户管理路由*/
Route::get('user/manage', ['as' => 'admin.user.manage', 'uses' => 'UserController@index']);  //用户管理
Route::post('user/index', ['as' => 'admin.user.index', 'uses' => 'UserController@index']);
Route::resource('user', 'UserController');
Route::put('user/update', ['as' => 'admin.user.edit', 'uses' => 'UserController@update']); //修改
Route::post('user/store', ['as' => 'admin.user.create', 'uses' => 'UserController@store']); //添加

/*站点配置*/
Route::get('site/manage', ['as' => 'admin.site.manage', 'uses' => 'SiteController@index']);   //站点管理
//基本配置
Route::get('site/index', ['as' => 'admin.site.index', 'uses' => 'SiteController@index']);
//系统参数
Route::get('site/sys_param', ['as' => 'admin.site.index', 'uses' => 'SiteController@sysParam']);
//自定义配置
Route::get('site/create', ['as' => 'admin.site.index', 'uses' => 'SiteController@create']);
//邮件配置
Route::get('site/email', ['as' => 'admin.site.index', 'uses' => 'SiteController@email']);
//保存所有相关配置
Route::post('site/index', ['as' => 'admin.site.create', 'uses' => 'SiteController@store']);
Route::resource('site', 'SiteController');


Route::get('site/recommend', ['as' => 'admin.recommend.index', 'uses' => 'SiteController@index']);


